package com.annoncesautomobile.vue.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.annoncesautomobile.R;

public class ModalOk {

	public static void displayModalOk(Context context, String titre) {
		final Dialog dialog = new Dialog(context);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setContentView(R.layout.modal_ok);
		final TextView text = (TextView) dialog.findViewById(R.id.text);
		text.setText(titre);

		Button buttonNogo = (Button) dialog.findViewById(R.id.buttonOk);
		buttonNogo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				dialog.dismiss();
			}
		});

		dialog.show();
	}
}
